The present invention relates to the field of embedded systems. More particularly, the invention relates to an effective method and apparatus for upgrading software versions which are used to control the operation of embedded systems, by downloading new software versions, on-board and using a fail-safe procedure, into a single non-volatile memory of an embedded system.
Embedded systems are widely used in industry and in office and consumer products. Actually, embedded systems include almost any device, which employs a microprocessor and/or a microcontroller and is not directed only to general-purpose computation. The control system is xe2x80x9cembeddedxe2x80x9d into the device and is an integral part of it. Such devices are used to control, monitor or assist the operation of machinery and equipment of many types. For example, telephones, and many other electronic devices are operated and controlled by a firmware, which is a specific software that is stored in (or xe2x80x9cburnedxe2x80x9d into) a memory of the electronic device, and is constantly called by a controller and/or a processing unit which normally operates the device.
In many devices, the firmware is linked to a database, which is also stored in the same or in another memory, and contains necessary information, required for proper operation of the device. Normally, the device contains a specific Printed Circuit Board (PCB), on which the controller or the processing unit, and the required linked memories are assembled (normally soldered). This PCB structure is widely used, since it saves space and is cost effective in mass-production. Original versions of the firmware and the contents of the database, are initially downloaded into the memory of the device by the manufacturer, before delivery to the customer, and in conjunction with a processor or a controller, serve as an operating system of the device.
In many cases, improvements in the features of the device are desired as time progresses, due to customer demands, and new features are offered by the manufacturer who continues with research and development activity in order to improve the capability of the device. Such improvements may be implemented by upgrading the firmware and/or the contents of the database in the device, from time to time, with a new version. This upgrade requires downloading of the new version, and overwriting (programming) the memory cells which contain the preceding firmware and database version. Upgrading may be carried out in the field, by a technician, or by a data source such as a Personal Computer (PC), via a data communication link which is connected to the device, so as to eliminate the need of returning the device to the manufacturer for upgrading. In addition, it is highly desired to enable an on-board upgrade, i.e., to eliminate disassembly of the upgradeable components (e.g. memory devices) from the PCB.
Most of the embedded systems employ an initialization process, known as a xe2x80x9cbootxe2x80x9d operation, in which a basic software or specific instructions are loaded from a boot sector (a sector represents a unit of storage space) of a memory, until the system is brought into its normal operation mode. Booting capability should be sustained even when the download process has failed, or the downloaded firmware version is corrupted for any reason, so as to enable another download and programming process. Therefore, boot instructions should be stored and recovered safely whenever a failure in the downloading or the programming process occurs. A typical known solution is to store the boot instructions in a Read Only Memory (ROM), which is non-volatile (i.e., it retains its stored data with no need for power supply) and is write protected. However, even though a ROM has a relatively high density, it is not upgradeable and should be operated with additional reprogrammable non-volatile memories to enable the stored firmware version to be overwritten. Therefore, this solution is not flexible or cost effective since more than one non-volatile memory is required, which also consumes precious PCB area and the boot sector can not be upgraded. Moreover, initial programming of a ROM is relatively time consuming, and is cost-effective mostly in mass production.
U.S. Pat. No. 5,666,293 discloses a method for upgrading the operating system software of terminal devices by downloading new versions through a broadcast channel. Upgrading is carried out by performing a cyclic broadcast of a packetized data file, which contains the operating system, which is captured and stored by the terminal devices. However, the operating system upgrade routine is stored in a ROM which is operated alone or with combination with a write protected sector of a Non-Volatile Random Access Memory (NVRAM). In addition, booting up the operating system, which is stored in the NVRAM, is carried out by a loader program, which is stored in a ROM and is not upgradeable.
U.S. Pat. No. 5,647,986 discloses an automated apparatus for wastewater treatment, which is controlled by a controller. The controller includes a combination of a flash memory and a boot memory, with remote programming capability. The flash memory stores the operating program of the apparatus and the boot memory contains a boot code, which is required to handle basic communication and reprogramming of the flash memory. The controller establishes a connection with a central computer from which a new operating program is downloaded, and receives a command to erase the contents of the flash memory. After the contents of the latter have been erased, the controller begins to reprogram the flash memory with data that is transmitted from the central computer. After the programming is completed, the controller reboots the processing unit of the apparatus and the apparatus starts to operate according to the updated operating program. However, this apparatus has no backup or reboot capability in the event of a failure during download and/or programming process and requires a separate non-upgradable boot memory.
The art has not yet provided satisfactory solutions to the problem of on-board downloading new software and boot versions into a single non-volatile memory of an embedded system, using a fail-safe procedure, that also allows for upgrading of the download control program.
It is an object of the present invention to provide a method and apparatus for downloading new software and boot versions into the memory of an embedded system, using a fail-safe procedure.
It is another object of the present invention to provide a method and apparatus for downloading new software and boot versions into the memory of an embedded system, which is carried out on-board and in the field.
It is a further object of the present invention to provide a method and apparatus for downloading new software and boot versions into the memory of an embedded system, which employs a single non-volatile memory component.
Other objects and advantages of the invention will become apparent as the description proceeds.
The invention is directed to a method for field upgrading of an operating software and/or initialization program version of an embedded-system. A single non-volatile memory component, such as a flash memory, is divided into a write-protected area and an unprotected area. The unprotected area is used to store downloaded software versions. The hardware write protected area in the flash memory is used to store an original version of the initialization and download program, and may be programmed only by relatively high voltage which is not available in the field. The original protected initialization and download program functions as a backup program, which is used to perform a new downloading process whenever a current downloading process fails. The write-protected area eliminates the need for additional non-volatile memory, such as a ROM.
Preferably, the last valid version of the initialization and download program, which is stored in the flash memory, is copied into a volatile memory, such as a RAM, and the embedded-system is operated from the RAM. This enables the downloading process of a new initialization program and operating software version during normal operation of the embedded-system. Preferably, at the initialization process, the initialization and download program is copied into the RAM and the embedded-system is operated from the RAM to perform initialization and downloading functions, if desired. Alternatively, all or part of the system functions may be duplicated and operated from the RAM to allow additional functionality during the upgrade process.
Downloading is carried out via a data receiving input into the embedded-system. The downloaded data is verified and if found valid, is programmed into the unprotected area of the flash memory. Alternatively, in order to be upgraded, the flash memory may first be erased, and the data is stored directly into the unprotected area of the flash memory. If a downloading process is disrupted by an unrecoverable error, it may be completed after activating the original initialization process from the write protected areas of the flash memory, or an updated initialization process from the unprotected areas of the flash memory. The downloading and programming process is restarted from the beginning, or alternatively continued from the detection point of the data error. After programming, the system is rebooted and the updated initialization process stored in the unprotected area of the flash memory is activated, copied into the RAM and the embedded-system is operated by the new operating software version. Alternatively, all or part of the operating software may be copied into, and subsequently run from, the RAM.
Preferably, downloading of a new version is carried out in the field by a data source, such as a PC, which is connected to the data receiving input of the embedded system, or from a remote data source by transmitting data groups from the remote source over a data link into the data receiving input of the embedded system.
The invention is also directed to an embedded system having in field and on-board upgrading capability of its operating software and/or initialization program version without affecting its normal operation. The embedded system comprises
a single non-volatile memory component containing a write protected area for storing an original initialization and download program of the embedded system and an unprotected area for storing at least updated version of the initialization and download program;
a volatile memory for storing initialization programs and/or operating software versions of the embedded-system, which enables simultaneous operation and reprogramming of new versions;
a control circuitry for controlling the initialization process and the operation of the embedded-system, for copying the contents of the non-volatile memory into the volatile memory and for downloading, verifying and programming new versions of said operating software and/or said initialization program; and
a data receiving input for downloading software and/or said initialization program versions.